#include<stdio.h>

int removeElement(int* nums, int numsSize, int val) {
    int src = 0;
    int dest = 0;
    while (src < numsSize)
    {
        if (nums[src] != val)
        {
            nums[dest] = nums[src];
            src++;
            dest++;
        }
        else
        {
            src++;
        }
    }
    return dest;
}